import request from '../utils/request'
const getChannels = () => {
  return request({
    url: '/v1_0/user/channels',
    method: 'get'
  })
}
// 抽取方法 频道的文章
/* eslint-disable */
const getArticles = ({ timestamp, channel_id }) => {
  return request({
    url: '/v1_0/articles',
    method: 'get',
    params: {
      with_top: 1, // 获取置顶文章
      timestamp, // 获取分页数据的时间戳
      channel_id // 频道的id
    }
  })
}
/* eslint-disable */
const disLikeArticle = ({ target }) => {
  return request({
    url: '/v1_0/article/dislikes',
    method: 'post',
    data: {
      target
    }
  })
}
const reportArticle = ({ target, type }) => {
  return request({
    url: '/v1_0/article/reports',
    method: 'post',
    data: {
      target,
      type
    }
  })
}
export { getChannels, getArticles, disLikeArticle, reportArticle }
